package com.bjpowernode;

import com.bjpowernode.ba05.Target;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest05 {

    @Test
    public void test01(){
        String configure="ba05/applicationContext.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(configure);

        Target proxy=(Target) applicationContext.getBean("target");
       proxy.doMethod();
       //目标类如果没有接口则使用的是cglib代理
        System.out.println(proxy.getClass().getName());

    }
}
